package com.handsome.controller;

import com.handsome.dto.BootstrapDataTableDto;
import com.handsome.service.MemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class MemberController extends BaseController {

    @Autowired
    private MemberService memberService;

    @RequestMapping("/member/index")
    public String index() {
        return "member/index";
    }

    @RequestMapping("/member/role")
    public String role() {
        return "member/role";
    }

    @GetMapping("/member/get_members")
    @ResponseBody
    public BootstrapDataTableDto getMembers() {
        return memberService.getMemberList();
    }

    @GetMapping("/member/get_roles")
    @ResponseBody
    public BootstrapDataTableDto getRoles() {
        return memberService.getRoles();
    }


}
